package com.navigation;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.SimpleAdapter;

import com.kogi.patterns.MyExpandableListAdapter;
import com.kogi.patterns.R;
import com.kogi.patterns.dummy;
import com.kogi.patterns.main;

public class navigationMain extends Activity{
	
	//ExpandableListAdapter mAdapter;
	MyExpandableListAdapter mAdapter;
	private Intent con,dashCat,segmented,sliderNavigation;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_navigation);
        
        Activity a=this; 
        ExpandableListView epView = (ExpandableListView) findViewById(R.id.expandableListView1);
        mAdapter = new MyExpandableListAdapter(a);
        epView.setAdapter(mAdapter);
        
        
        //vistas
        con = new Intent(navigationMain.this,dummy.class);
        dashCat = new Intent(navigationMain.this,primero.class);
        segmented = new Intent(navigationMain.this,SegmentedControl.class);
        sliderNavigation = new Intent(navigationMain.this,com.navigation.slidablenavigation.SlidableNavigation.class);
         
        epView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
            
			@Override
			public boolean onChildClick(ExpandableListView arg0, View arg1,
					int arg2, int arg3, long arg4) {
				
				if(arg2==0 && arg3==1){
					startActivity(dashCat);
				}
				else if(arg2==1 && arg3==2){
					startActivity(segmented);
				}
				else if(arg2==1 && arg3==8){
					startActivity(sliderNavigation);
				}
				else if(arg2==3 && arg3==3){
					startActivity(sliderNavigation);
				}
				else{
					startActivity(con);
				}
				return false;
			}
            }); 
         
        
        
	}

	 

}
